<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"> 
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Juízes</h2>
            <p:panel styleClass="container_24 clearfix "  style="background: none; border: none;">
                <h:form id="form" acceptcharset="utf-8">
                    <p:growl id="msg" life="5000"/>
                    <p:menu styleClass="grid_5" >  
                        <p:submenu label="Menu">  
                            <p:menuitem value="Cadastrar" actionListener="#{managerRedirect.redirect('createExecutor.xhtml')}"
                                        update="@form" icon="ui-icon-circle-plus"/>  
                            <p:menuitem value="Pesquisar" actionListener="#{managerRedirect.redirect('searchExecutor.xhtml')}"
                                        icon="ui-icon-circle-zoomout"/>   
                        </p:submenu>
                    </p:menu>

                    <div class="grid_18">
                        <p class="subtitle" style="margin-top: -40px;">Recentes</p>
                        
                    <p:dataTable value="#{managerSearchExecutor.lstEscutors()}"
                                 var="e" emptyMessage="Nenhum Questionário"
                                 styleClass="dataTable">  

                        <p:column headerText="Nome" style="font-size: 12px;">
                            <h:outputText value="#{e.name}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Oab" style="font-size: 12px; width: 20%;">
                            <h:outputText value="#{e.oab}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Contato" style="font-size: 12px; width: 20%;">
                            <h:outputText value="Cel: #{e.address.cellular} Tel: #{e.address.phone} " style="font-size: 12px;"/>
                        </p:column>

                        <p:column headerText="Opções" style="font-size: 12px;">
                            <p:commandButton icon="ui-icon-folder-collapsed" actionListener="#{managerEditExecutor.redirect('editExecutor.xhtml', e)}" title="Editar" />
                            <p:commandButton icon="ui-icon-circle-zoomin" actionListener="#{managerSearchExecutor.redirect('showExecutor.xhtml', e)}" title="Visualizar" />
                            <p:commandButton icon="ui-icon-locked" actionListener="#{managerCreateAcess.redirect('acess.xhtml', e)}" title="Nível de Acesso" />
                            <p:commandButton icon="ui-icon-trash" title="Excluir" update="@form"  />
                        </p:column>
                    </p:dataTable>
                    </div>
                </h:form>
            </p:panel>
        </ui:define>
    </ui:composition>
</html>